. "$PSScriptRoot/common.ps1"

$i = 0
$projectsCount = $projects.length
foreach ($project in $projects) {
    $i += 1
    $projectFolder = Join-Path $rootFolder $project
    Write-Info "[$i / $projectsCount] - Building project: $project"
    Set-Location $projectFolder
    
    dotnet restore
    dotnet build --configuration Release
    if ($LASTEXITCODE -ne 0) {
        Write-Error "编译失败，终止后续操作！"
        exit 1
    }
    Seperator
}

Write-Info "所有项目编译完成！" 